<?php

namespace app\admin\validate;

use think\Validate;

class Module extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'identifier'  => 'require|max:100',
        'name'  => 'require|max:100',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'identifier.require'  =>  '标识不能为空',
        'identifier.max'  =>  '标识必须小于 100 个字符',
        'name.require'  =>  '模块名称不能为空',
        'name.max'  =>  '模块名称必须小于 100 个字符',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['identifier','name','desciption', 'author', 'email', 'siteurl', 'version'],
        'edit' => ['identifier','version'],
    ];
    
}
